package org.jeecgframework.web.system.service;

import javax.servlet.http.HttpServletRequest;

import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.common.service.CommonService;

import org.jeecgframework.web.system.pojo.base.TSUser;

import java.util.List;

/**
 * @author 张代浩
 */
public interface UserService extends CommonService {

    public TSUser checkUserExits(TSUser user);

    public TSUser checkAppUserExits(TSUser user);

    public TSUser checkUserExitsByPhone(TSUser user);

    public String getUserRole(TSUser user);

    public void pwdInit(TSUser user, String newPwd);

    /**
     * 判断这个角色是不是还有用户使用
     *
     * @param id
     * @return
     * @Author JueYue
     * @date 2013-11-12
     */
    public int getUsersOfThisRole(String id);

    /**
     * @param mobilePhone
     * @author xiul
     * 2016-8-4 上午9:57:03
     * Description
     */
    public void doChangeAppuserMobilePhone(String mobilePhone);

    /**
     * @author xiul
     * 2016-11-11 下午3:35:36
     * Description APP 用户修改邮箱
     */
    public void doAppChangeEmail(HttpServletRequest req, AjaxJson j);

    public int getUserCountOfThisRoleCode(String roleCode);

    public boolean hasRole(String userName, String roleCode);
    
    //用户是否包含其中一个角色
    public boolean hasRoles(String userName, String[] roleCode);

    public String assebleChainLogo(String bpCode);

    public TSUser addWxUser(String openId, String realName, String userName, String phone, String authLevel,String headImg);

    public List<TSUser> getUserByMobilePhone(String mobilePhone);
}
